using FluentNHibernate.Mapping;
using Subfaculty.Common.Entities;

namespace Subfaculty.Infrastructure.Repositories.Mapping
{
	public class StudyPlanMapping : ClassMap<StudyPlan>
	{
		public StudyPlanMapping()
		{
			Id(x => x.Id).GeneratedBy.Identity();

			References(x => x.StudyArea).Cascade.SaveUpdate();
			HasMany(x => x.StudyPlanSemesters).KeyColumn("StudyPlanId").Inverse().Cascade.AllDeleteOrphan();
		}
	}

	public class StudyGroupMapping : ClassMap<StudyGroup>
	{
		public StudyGroupMapping()
		{
			Id(x => x.Id).GeneratedBy.Identity();

			References(x => x.StudyArea).Cascade.SaveUpdate();
			References(x => x.StartStudyYear).Cascade.SaveUpdate();
		}

	}

	//public class StudyGroupStateMapping : ClassMap<StudyGroupState>
	//{
		
	//}
}